home *** CD-ROM | disk | FTP | other *** search
- Path: news.umbc.edu!not-for-mail
- From: schlein@umbc.edu (Jonas J. Schlein)
- Newsgroups: comp.lang.c
- Subject: Re: making #define's to be seen across files
- Date: 19 Apr 1996 01:18:32 -0400
- Organization: University of Maryland Baltimore County
- Message-ID: <4l77n8$pso@umbc9.umbc.edu>
- References: <1996Apr9.164443.28709@relay.nswc.navy.mil>
- NNTP-Posting-Host: umbc9.umbc.edu
- NNTP-Posting-User: schlein
-
- |> I have some C code divided into different source files.
- |> When I try to compile using
- |> "cc file1.c file2.c file3.c"
- |> the constants #define'd in file1.c are not visible in file2.c, is there a
- |> way to make them visible to the other source files? In other words, is
- |> there som equivalent to "extern" for constants?
-
- Make a common header file and #include this in all of your other files.
- That way they will be visible to all your source files. Sorta like when
- you #include <stdio.h> everywhere.
- --
- "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
-
- Jonas J. Schlein (schlein@gl.umbc.edu)
-